﻿package mortal.game.model
{
    import Message.Client.*;
    import Message.DB.Tables.*;
    import Message.Public.*;
    import mortal.game.resource.tableConfig.*;

    public class NPCInfo extends Object
    {
        private var _snpc:SNpc;
        private var _tnpc:TNpc;
        private var _minShowLevel:int;
        private var _maxShowLevel:int = 2147483647;
        private var _taskStatus:int = -1;
        public var isAddStage:Boolean = true;
        public var isClick:Boolean = true;
        public var npcNeerTalkId:int;
        public var npcCloseTalkId:int;

        public function NPCInfo()
        {
            return;
        }// end function

        public function get tnpc() : TNpc
        {
            return this._tnpc;
        }// end function

        public function get snpc() : SNpc
        {
            return this._snpc;
        }// end function

        public function set snpc(param1:SNpc) : void
        {
            var _loc_2:Array = null;
            var _loc_3:int = 0;
            var _loc_4:Array = null;
            this._taskStatus = -1;
            this._snpc = param1;
            this._tnpc = NPCConfig.instance.getInfoByCode(this._snpc.npcId);
            if (this._tnpc && this._tnpc.topTalk)
            {
                _loc_2 = this._tnpc.topTalk.split("&");
                _loc_3 = 0;
                while (_loc_3 < _loc_2.length)
                {
                    
                    _loc_4 = String(_loc_2[_loc_3]).split("#");
                    switch(int(_loc_4[0]))
                    {
                        case ENPCTalkType._ENPCTalkTypeNormal:
                        {
                            this.npcNeerTalkId = int(_loc_4[1]);
                            break;
                        }
                        case ENPCTalkType._ENPCTalkTypeCloseTalk:
                        {
                            this.npcCloseTalkId = int(_loc_4[1]);
                            break;
                        }
                        default:
                        {
                            break;
                        }
                    }
                    _loc_3++;
                }
            }
            return;
        }// end function

        public function set taskStatus(param1:int) : void
        {
            this._taskStatus = param1;
            return;
        }// end function

        public function get taskStatus() : int
        {
            return this._taskStatus;
        }// end function

        public function get headImgsrc() : String
        {
            return "";
        }// end function

        public function get headImgCode() : String
        {
            return "";
        }// end function

        public function get minShowLevel() : int
        {
            return this._minShowLevel;
        }// end function

        public function get maxShowLevel() : int
        {
            return this._maxShowLevel;
        }// end function

        public function get width() : Number
        {
            return 80 * this._tnpc.modelScale / 100;
        }// end function

        public function get height() : Number
        {
            return 110 * this._tnpc.modelScale / 100;
        }// end function

    }
}
